<template>
    <div>
        <el-select v-model="selectValue" class="m-2" :placeholder="placeholder">
            <el-option v-for="item in info.list" :key="item.value" :label="item.label" :value="item.value" />
        </el-select>
    </div>
</template>

<script lang="ts" setup name="SGSelect">
import type { PropType } from 'vue';
import type { IComponentInfoType } from '@/types/component';

const props = defineProps({
    info: {
        required: true,
        type: Object as PropType<IComponentInfoType>,
        default: () => {}
    }
});

const placeholder = computed(() => {
    return props.info.placeholder || `请选择`;
});

const selectValue = defineModel();
</script>
